import 'package:flutter_xj_video/entity/film_entity.dart';

filmEntityFromJson(FilmEntity data, Map<String, dynamic> json) {
	if (json['rss'] != null) {
		data.rss = FilmRss().fromJson(json['rss']);
	}
	return data;
}

Map<String, dynamic> filmEntityToJson(FilmEntity entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['rss'] = entity.rss?.toJson();
	return data;
}

filmRssFromJson(FilmRss data, Map<String, dynamic> json) {
	if (json['list'] != null) {
		data.xList = FilmRssList().fromJson(json['list']);
	}
	return data;
}

Map<String, dynamic> filmRssToJson(FilmRss entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['list'] = entity.xList?.toJson();
	return data;
}

filmRssListFromJson(FilmRssList data, Map<String, dynamic> json) {
	if (json['video'] != null) {
		data.video = (json['video'] as List).map((v) => FilmRssListVideo().fromJson(v)).toList();
	}
	return data;
}

Map<String, dynamic> filmRssListToJson(FilmRssList entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['video'] =  entity.video?.map((v) => v.toJson())?.toList();
	return data;
}

filmRssListVideoFromJson(FilmRssListVideo data, Map<String, dynamic> json) {
	if (json['last'] != null) {
		data.last = json['last'].toString();
	}
	if (json['id'] != null) {
		data.id = json['id'].toString();
	}
	if (json['tid'] != null) {
		data.tid = json['tid'].toString();
	}
	if (json['name'] != null) {
		data.name = json['name'].toString();
	}
	if (json['type'] != null) {
		data.type = json['type'].toString();
	}
	if (json['pic'] != null) {
		data.pic = json['pic'].toString();
	}
	if (json['lang'] != null) {
		data.lang = json['lang'].toString();
	}
	if (json['area'] != null) {
		data.area = json['area'].toString();
	}
	if (json['year'] != null) {
		data.year = json['year'].toString();
	}
	if (json['state'] != null) {
		data.state = json['state'].toString();
	}
	if (json['note'] != null) {
		data.note = json['note'].toString();
	}
	if (json['actor'] != null) {
		data.actor = json['actor'].toString();
	}
	if (json['director'] != null) {
		data.director = json['director'].toString();
	}
	if (json['dl'] != null) {
		data.dl = FilmRssListVideoDl().fromJson(json['dl']);
	}
	if (json['des'] != null) {
		data.des = json['des'].toString();
	}
	return data;
}

Map<String, dynamic> filmRssListVideoToJson(FilmRssListVideo entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['last'] = entity.last;
	data['id'] = entity.id;
	data['tid'] = entity.tid;
	data['name'] = entity.name;
	data['type'] = entity.type;
	data['pic'] = entity.pic;
	data['lang'] = entity.lang;
	data['area'] = entity.area;
	data['year'] = entity.year;
	data['state'] = entity.state;
	data['note'] = entity.note;
	data['actor'] = entity.actor;
	data['director'] = entity.director;
	data['dl'] = entity.dl?.toJson();
	data['des'] = entity.des;
	return data;
}

filmRssListVideoDlFromJson(FilmRssListVideoDl data, Map<String, dynamic> json) {
	if (json['dd'] != null) {
		data.dd = json['dd'].toString();
	}
	return data;
}

Map<String, dynamic> filmRssListVideoDlToJson(FilmRssListVideoDl entity) {
	final Map<String, dynamic> data = new Map<String, dynamic>();
	data['dd'] = entity.dd;
	return data;
}